package homework;

import java.util.Scanner;

public class X_Remainder_rangeAB {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
        // 获取输入的三个整数
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        // ---------------------Begin------------------------
        // 确定范围的起始和结束
        int start = Math.min(a, b);
        int end = Math.max(a, b);

        // 构建输出字符串
        StringBuilder result = new StringBuilder();

        boolean found = false;
        for (int num = start; num <= end; num++) {
            if (c != 0 && num % c == 0) { // 避免除以零的情况
                result.append(num).append("\n");
                found = true;
            }
        }

        if (found) {
            System.out.print(result.toString().trim());
        } else {
            System.out.println("区间 [" + a + ", " + b + "] 内没有能被 " + c + " 整除的整数");
        }
        // ---------------------End------------------------
		
	}

}
